package com.ikas.ai.framework.node;

/**
 * @Description: 节点类型
 * @Author: qi.yilai
 * @Date: 2023/1/12 16:18
 * @Version: 1.0.0
 **/
public enum NodeType {

    // 数据节点
    DATA("Data", "测点最新数据"),

    // 公式计算
    MATH_CALC("MathCalculate", "公式计算"),

    // 断言
    PREDICT("Predict", "条件判断"),

    // 模型计算
    MODEL_CALC("Model", "模型计算"),

    // 结束节点
    END("End", "终点"),

    // 批量数据获取
    BATCH_DATA("BatchData", "测点批量数据"),

    // 数学统计
    MATCH_STATISTICS("MatchStatistics", "数学统计"),

    // and组合判断
    AND_PREDICT("AndPredict", "AND组合判断"),

    // OR组合判断
    OR_PREDICT("OrPredict", "OR组合判断"),

    //条件判断
    COMPOSITE_PREDICT("CompositePredict", "条件组合判断"),

    //业务常量
    BUSINESS_CONSTANT("BusinessConstant", "业务常量"),
    ;

    private String name;

    private String cnName;

    NodeType(String name, String cnName) {
        this.name = name;
        this.cnName = cnName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCnName() {
        return cnName;
    }

    public void setCnName(String cnName) {
        this.cnName = cnName;
    }

    public static NodeType of(String name) {
        NodeType[] types = NodeType.values();
        for (NodeType nodeType : types) {
            if (nodeType.getName().equals(name)) {
                return nodeType;
            }
        }
        return null;
    }
}
